package com.v2.k25;


import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.sql.DataSource;

@Component
public class TransactionAnnotationService {

	private JdbcTemplate jdbcTemplate;

	public TransactionAnnotationService(DataSource dataSource) {
		this.jdbcTemplate = new JdbcTemplate(dataSource);
	}

	@Transactional
	public void test() {
		jdbcTemplate.execute("insert into order_item_his(order_item_id, his_shard) values(130,'2021-06-06');");
	}

}
